home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Image Engineer ARexx macro script */ /* by Simon Edwards */ /* 4/4/95 */ /* MakeIcon V1.0 */ /* */ /* Renders an icon of an image and saves it to */ /* the clipboard for pasting into IconEdit. */ Options results signal on error /* Setup a place for errors to go */ if arg()==0 then exit PROJECT_INFO arg(1) WIDTH ImageWidth=RESULT PROJECT_INFO arg(1) HEIGHT ImageHeight=RESULT if ImageWidth/ImageHeight>2.0 then do NewWidth=80 NewHeight=ImageHeight*80.0/ImageWidth end else do NewWidth=ImageWidth*40.0/ImageHeight NewHeight=40 end SCALE arg(1) NewWidth NewHeight BEST icon=RESULT 'LOAD_PALETTE' icon '"IE:palettes/wb.palette"' RENDER_DEPTH icon 4 RENDER_COLOURS icon 4 RENDER_DEVICE icon AMIGA RENDER_DITHER icon FLOYD PROJECT_INFO icon TYPE if RESULT=='GREY' then RENDER_QUANTIZE icon LOCK else RENDER_QUANTIZE icon LOCK_BEST RENDER icon SAVE_CLIP icon CLOSE icon exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end